/**
 * 
 */
package com.atjava.nebula.core.dao.ibatis;

import com.atjava.nebula.core.dao.ibatis.projection.IProjection;

/**用于包装Projection和Condition参数，传到sqlmap里
 * @author kyo
 *
 */
public class ProjAndCond extends Condition{
	String sqlString;
	String groupString;
	//Condition condition;
	public ProjAndCond(IProjection project,Condition cond){
		if(cond != null)
			AddCondition(cond);
		if(project.toSqlString() != null && !project.toSqlString().equals("")){
			sqlString=project.toSqlString();
		}
		else //如果投影字段为空，则默认选择所有字段
			sqlString = " * ";
		
		groupString=project.toGroupSqlString();
		//condition = cond;
	}
	public ProjAndCond(IProjection project){
		this(project,null);
	}

	/**
	 * @return the groupString
	 */
	public String getGroupString() {
		return groupString;
	}
	/**
	 * @param groupString the groupString to set
	 */
	public void setGroupString(String groupString) {
		this.groupString = groupString;
	}
	/**
	 * @return the sqlString
	 */
	public String getSqlString() {
		return sqlString;
	}
	/**
	 * @param sqlString the sqlString to set
	 */
	public void setSqlString(String sqlString) {
		this.sqlString = sqlString;
	}
	
}
